1. Field of the Invention
The present invention relates to the process of configuring device drivers in a computer system. More specifically, the present invention relates to a method and an apparatus for communicating between device drivers in a computer system.
2. Related Art
Although computer systems are often built using standard hardware devices and components, the specific configuration of the devices and components can vary greatly between different computer system implementations. This configuration often affects the way the devices are controlled. When the computer system needs to change the state of a device, the computer system typically calls a driver, which contains all of the necessary information for interacting with the device. However, it can be difficult to control other computer system components outside of the device that affect the state of the device. For example, the clock and the power for a device are often managed through the use of a General Purpose Input Output (GPIO), or through a bit in a configuration register of the parent chip. In order to control these related components, a device driver can be specially configured to control these components. However, this means that device drivers may need to be reconfigured differently for each type of system configuration, which is a time-consuming and error-prone process.
Another example of where it is hard to control components associated with a device is interrupts. Interrupts are sometimes not routed to the driver responsible for taking action on the interrupt. For instance, an audio driver may expect to receive an interrupt for the audio hardware, but the interrupt for the headphone jack may come through a GPIO.
In yet another example, some hot-swappable devices need to know about the position of a release switch that needs to be released before the device can be physically removed from the computer system.
Designing systems to allow devices and drivers to be aware of hardware states outside of their control can be expensive and can require drivers to be modified for each different hardware configuration. Hence, what is needed is a method and an apparatus for configuring drivers to operate with hardware within a computer systems without the problems described above.